	title crt0.asm
	.model	tiny
	.386p
	.387

_TEXT SEGMENT WORD USE16 PUBLIC 'CODE'
	EXTERN	@nbp_entry:near
_TEXT ENDS

_DATA SEGMENT WORD USE16 PUBLIC 'DATA'
_DATA ENDS

CONST SEGMENT WORD USE16 PUBLIC 'CONST'
CONST ENDS

_BSS SEGMENT WORD USE16 PUBLIC 'BSS'
_BSS ENDS

DGROUP GROUP _TEXT, CONST, _BSS, _DATA
	ASSUME DS:DGROUP, SS:NOTHING

_TEXT SEGMENT
	org	7c00h
nbp_entry proc far
	push	bp
	mov	bp, sp

	push	ebx
	push	ecx
	push	edx
	push	ebp
	push	esi
	push	edi

	push	ds
	push	es
	push	fs
	push	gs
	
	push	cs
	pop	ds

	pushd	[bp + 6]

	push	es
	push	bx

	call	@nbp_entry

	pop	gs
	pop	fs
	pop	es
	pop	ds

	pop	edi
	pop	esi
	pop	ebp
	pop	edx
	pop	ecx
	pop	ebx

	nop

	pop	bp
	ret
nbp_entry endp

_TEXT ENDS

_DATA SEGMENT
__nul__	dd	0
_DATA ENDS

	END

